<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	template="/pages/template/template.xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" 
	xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
	<ui:define name="pageTitle">Web Chat - Atendimento ao usuario</ui:define>
	<ui:define name="conteudo">
		<t:saveState value="#{userBean.cliente}" ></t:saveState>
		
		<a4j:poll reRender="clientePosicao" interval="3000" action="#{userBean.verificarChatPronto}">
			<f:setPropertyActionListener value="#{userBean.cliente}" target="#{chatBean.pessoaVisivel}"></f:setPropertyActionListener>
		</a4j:poll>
		
			<ui:include src="/pages/usuario/formPosicaoCliente.xhtml" >
				<ui:param name="mBean" value="#{userBean}" />
			</ui:include>
		
		<div class="boxBotoes">
			<h:commandButton value="Cancelar" styleClass="botaoSecundario"
				action="#{userBean.cancelarAtendimento}" />
		</div>
	</ui:define>
</ui:composition>